<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenShoe: usbc_device.c File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenShoe
   &#160;<span id="projectnumber">0.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#define-members">Defines</a>  </div>
  <div class="headertitle">
<div class="title">usbc_device.c File Reference</div>  </div>
</div>
<div class="contents">

<p>USB Device driver Compliance with common driver UDD.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="conf__usb_8h_source.html">conf_usb.h</a>&quot;</code><br/>
<code>#include &quot;sysclk.h&quot;</code><br/>
<code>#include &quot;<a class="el" href="udd_8h_source.html">udd.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="usbc__otg_8h_source.html">usbc_otg.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="usbc__device_8h_source.html">usbc_device.h</a>&quot;</code><br/>
<code>#include &lt;string.h&gt;</code><br/>
<code>#include &quot;sleepmgr.h&quot;</code><br/>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="usbc__device_8c.html#a5326d0dfa348635327c3562b130be6b3">UDD_USB_INT_LEVEL</a>&#160;&#160;&#160;0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="usbc__device_8c.html#ab9a7dacc289d5123cea5f0f25198d14c">AVR32_PM_AWEN_USBCWEN_MASK</a>&#160;&#160;&#160;0x01</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Management of bulk/interrupt/isochronous endpoints</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>Buffer to store the data received on control endpoint (SETUP/OUT endpoint 0)</p>
<p>Used to avoid a RAM buffer overflow in case of the payload buffer is smaller than control endpoint size</p>
<p>The UDD manages the data transfer on endpoints:</p>
<ul>
<li>Start data tranfer on endpoint with USB Device DMA</li>
<li>Send a ZLP packet if requested</li>
<li>Call callback registered to signal end of transfer The transfer abort and stall feature are supported. </li>
</ul>
</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gaa4cac8c35ae056e26cf4ab5b426bbe09">udd_include_vbus_monitoring</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Authorizes the VBUS event.  <a href="group__udd__group.html#gaa4cac8c35ae056e26cf4ab5b426bbe09"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga9792d1899ae058e3984d6a622fe2ad42">udd_enable</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the USB Device mode.  <a href="group__udd__group.html#ga9792d1899ae058e3984d6a622fe2ad42"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gab283432057b934e9d73ac9282d9b0f11">udd_disable</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the USB Device mode.  <a href="group__udd__group.html#gab283432057b934e9d73ac9282d9b0f11"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga7a7c0d9236c922c2af33c6702565a99f">udd_attach</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Attach device to the bus when possible.  <a href="group__udd__group.html#ga7a7c0d9236c922c2af33c6702565a99f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga03e59eaa264f1dbe5a52559311d0520e">udd_detach</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Detaches the device from the bus.  <a href="group__udd__group.html#ga03e59eaa264f1dbe5a52559311d0520e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga85f403ddb78776b1ba014dafd3ffec2c">udd_is_high_speed</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Test whether the USB Device Controller is running at high speed or not.  <a href="group__udd__group.html#ga85f403ddb78776b1ba014dafd3ffec2c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga05da762e0faf9d478e532de40afa71f6">udd_set_address</a> (uint8_t address)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the USB address of device.  <a href="group__udd__group.html#ga05da762e0faf9d478e532de40afa71f6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gaebd36638d482f6df00a8aff006ef2246">udd_getaddress</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the USB address of device.  <a href="group__udd__group.html#gaebd36638d482f6df00a8aff006ef2246"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga96dc248cc05e07ffe2cf21e4d7465320">udd_get_frame_number</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current start of frame number.  <a href="group__udd__group.html#ga96dc248cc05e07ffe2cf21e4d7465320"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga63047eec59b8e8798ca1d3366472d82b">udd_get_micro_frame_number</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current micro start of frame number.  <a href="group__udd__group.html#ga63047eec59b8e8798ca1d3366472d82b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga14ae6068206556d6ae8766b1baa2f686">udd_send_wake_up</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The USB driver sends a resume signal called Upstream Resume.  <a href="group__udd__group.html#ga14ae6068206556d6ae8766b1baa2f686"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga017ef5ea7626be258c24d345218976f9">udd_set_setup_payload</a> (uint8_t *payload, uint16_t payload_size)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Load setup payload.  <a href="group__udd__group.html#ga017ef5ea7626be258c24d345218976f9"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Power management routine.</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gaf5ca2932775dabb853197df18706c469">USBC_SLEEP_MODE_USB_SUSPEND</a>&#160;&#160;&#160;SLEEPMGR_STATIC</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of sleep levels.  <a href="group__udd__group.html#gaf5ca2932775dabb853197df18706c469"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga90aeabbf00db4be8f0a1feef5cf0bbb3">USBC_SLEEP_MODE_USB_IDLE</a>&#160;&#160;&#160;SLEEPMGR_IDLE</td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Control endpoint low level management routine.</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrpc60f904f933dd5c177261b92bc2abc62"></a> This function performs control endpoint mangement. It handle the SETUP/DATA/HANDSHAKE phases of a control transaction. </p>
</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gabc925782d47feeb37f6f943579038b84">udd_ctrl_ep_state_t</a> { <br/>
&#160;&#160;<a class="el" href="group__udd__group.html#ggabc925782d47feeb37f6f943579038b84a2357a1ac77f59da70848f4121a016e77">UDD_EPCTRL_SETUP</a> =  0, 
<a class="el" href="group__udd__group.html#ggabc925782d47feeb37f6f943579038b84acf3cc280a0061ecf321e0191d37dc53c">UDD_EPCTRL_DATA_OUT</a> =  1, 
<a class="el" href="group__udd__group.html#ggabc925782d47feeb37f6f943579038b84a57e63cb5de1f85c276dbfa8c3c00deed">UDD_EPCTRL_DATA_IN</a> =  2, 
<a class="el" href="group__udd__group.html#ggabc925782d47feeb37f6f943579038b84aadbf4f42e07b8589262e727b3cf8b900">UDD_EPCTRL_HANDSHAKE_WAIT_IN_ZLP</a> =  3, 
<br/>
&#160;&#160;<a class="el" href="group__udd__group.html#ggabc925782d47feeb37f6f943579038b84ae5dd6cabf3ebb1aab6a80d7a92a89513">UDD_EPCTRL_HANDSHAKE_WAIT_OUT_ZLP</a> =  4, 
<a class="el" href="group__udd__group.html#ggabc925782d47feeb37f6f943579038b84a8d44562cd9ac18661adcf35015f8972e">UDD_EPCTRL_STALL_REQ</a> =  5
<br/>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Bit definitions about endpoint control state machine for udd_ep_control_state.  <a href="group__udd__group.html#gabc925782d47feeb37f6f943579038b84">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">COMPILER_WORD_ALIGNED <br class="typebreak"/>
<a class="el" href="structudd__ctrl__request__t.html">udd_ctrl_request_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga2a41c2b14c5be825bdce7fde8c365a30">udd_g_ctrlreq</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Global variable to give and record information about setup request management.  <a href="group__udd__group.html#ga2a41c2b14c5be825bdce7fde8c365a30"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>USB Device driver Compliance with common driver UDD. </p>
<p>Copyright (C) 2009 - 2011 Atmel Corporation. All rights reserved. </p>
</div><hr/><h2>Define Documentation</h2>
<a class="anchor" id="ab9a7dacc289d5123cea5f0f25198d14c"></a><!-- doxytag: member="usbc_device.c::AVR32_PM_AWEN_USBCWEN_MASK" ref="ab9a7dacc289d5123cea5f0f25198d14c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define AVR32_PM_AWEN_USBCWEN_MASK&#160;&#160;&#160;0x01</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a5326d0dfa348635327c3562b130be6b3"></a><!-- doxytag: member="usbc_device.c::UDD_USB_INT_LEVEL" ref="a5326d0dfa348635327c3562b130be6b3" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UDD_USB_INT_LEVEL&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Mon Dec 19 2011 21:04:53 for OpenShoe by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
